Fxattr

Section: Oct. 1, 1991 (2)
Updated: MiNT Programmer's Manual
Index Return to Main Contents
 

NAME

Fxattr - get extended attributes for a file  

SYNOPSIS

#include <filesys.h>

LONG Fxattr( WORD flag, char *name, XATTR *xattr );
 

DESCRIPTION

Fxattr gets file attributes for the file named name and stores them in the structure pointed to by xattr. This structure is defined in the file filesys.h, and contains the following fields of interest:
unsigned short mode
This field gives the file type and access permissions; (mode & S_IFMT) gives the file type (one of S_IFCHR, S_IFDIR, S_IFREG, S_IFIFO, S_IMEM, or S_IFLNK); (mode & ~S_IFMT) gives the file access mode according to the POSIX standard. See filesys.h for the definitions and meanings of the constants.
long index
An index for the file. Together with the "dev" field, this is intended to give a unique way of identifying the file. Note, however, that not all file systems are able to support this meaning, so it is best not to use this field unless absolutely necessary.
unsigned short dev
The device number for the file. This may be a BIOS device number as passed to the Rwabs function, or it may be a device number concocted by the file system to represent a remote device.
unsigned short nlink
Number of hard links to the file. Normally this field will be 1.
unsigned short uid
The user id of the owner of the file.
unsigned short gid
The group id of the owner of the file.
long size
The length of the file, in bytes.
long blksize
The size of blocks on this file system.
long nblocks
The number of physical blocks occupied by the file on the disk; this count includes any blocks that have been reserved for the file but do not yet have data in them, and any blocks that the file system uses internally to keep track of file data (e.g. Unix indirect blocks).
short mtime
The time of the last modification to the file, in standard GEMDOS format.
short mdate
The date of the last modification, in standard GEMDOS format.
short atime, adate
The time and date of the last access to the file, in GEMDOS format. Filesystems that do not keep this time will return the values given in "mtime" and "mdate" for these fields as well.
short ctime, cdate
The time and date of the file's creation, in GEMDOS format. Filesystems that do not keep this time will return the values given in "mtime" and "mdate" for these fields as well.
short attr
The standard TOS attributes for the file, as returned by Fattrib and/or Fsfirst.

The flag parameter controls whether or not symbolic links should be followed. If it is 0, then symbolic links are followed (like the Unix stat function). If flag is 1, then links are not followed and the information returned is for the symbolic link itself (if the named file is a symbolic link); this behavior is like that of the Unix lstat system call.  

RETURNS

0 on success

EFILNF if the file is not found

EPTHNF if the path to the file is not found.  

SEE ALSO

Fattrib(2), Fsnext(2)


 

Index

NAME
SYNOPSIS
DESCRIPTION
RETURNS
SEE ALSO

This document was created by man2html, using the manual pages.
Time: 16:01:23 GMT, March 03, 2023